const http = require("http");
const host = "localhost";
const port = 10000;

const server = http.createServer((req, resp) => {
	console.log(`received, url: ${req.url}, method: ${req.method}`);
	let body = "";
	req.on("data", (chunk) => body += chunk);
	req.on("end", () => {
		console.log(`body: ${body}`);
		resp.statusCode = 200;
		resp.end("OK");
	});
});

server.listen(port, host, () => {
	console.log(`Http server running at http://${host}:${port}`);
});